﻿@model JCTimes.DomainModel.Entity.User
@{
    ViewBag.Title = "客户编辑";
    var roleid = SessionHelper.CurrUser.RoleID;
}

@Styles.Render("~/Content/forms")
@using (Html.BeginForm())
{
    @Html.ValidationSummary(true)
    <fieldset>
        @Html.HiddenFor(u => Model.ID)
        <div class="editor-label">
            @Html.LabelFor(model => model.UserName)
        </div>
        <div class="editor-field">
            @Html.DisplayFor(model => model.UserName)
            @Html.ValidationMessageFor(model => model.UserName)
        </div>
        <div class="editor-label">
            @Html.LabelFor(model => model.Name)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.Name)
            @Html.ValidationMessageFor(model => model.Name)
        </div>
        @if (roleid == Constant.Admin)
        {
        <div class="editor-label">
            @Html.LabelFor(model => model.ParentID)
        </div>
        <div class="editor-field">
            @Html.DropDownListFor(model => model.ParentID, new DropDownList(DropDownListType.Agency), "--请选择--")
        </div>
        }
        <div class="editor-label">
            @Html.LabelFor(model => model.ContactName)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.ContactName)
            @Html.ValidationMessageFor(model => model.ContactName)
        </div>
        <div class="editor-label">
            @Html.LabelFor(model => model.Tel)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.Tel)
            @Html.ValidationMessageFor(model => model.Tel)
        </div>
        <div class="editor-label">
            @Html.LabelFor(model => model.Mobile)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.Mobile)
            @Html.ValidationMessageFor(model => model.Mobile)
        </div>
        <div class="editor-label">
            @Html.LabelFor(model => model.Address)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.Address)
            @Html.ValidationMessageFor(model => model.Address)
        </div>
        <div class="editor-label">
            @Html.LabelFor(model => model.QQ)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.QQ)
            @Html.ValidationMessageFor(model => model.QQ)
        </div>
        <div class="editor-label">
            @Html.LabelFor(model => model.Email)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.Email)
            @Html.ValidationMessageFor(model => model.Email)
        </div>
        <div class="editor-label">
            @Html.LabelFor(model => model.Remark)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.Remark)
            @Html.ValidationMessageFor(model => model.Remark)
        </div>
       
        <p style="text-align: center">
            <input class="button" type="submit" value="提交" />
            <input class="button" type="button" value="返回" onclick="location.href='@Url.Action("Index")'" />
        </p>
    </fieldset>
}
@section Scripts {
    @Scripts.Render("~/bundles/jqueryval")
}